<template>
  <div class="left-navigation">
    <!-- 主菜单区域 -->
    <el-menu class="main-menu"  default-active="1">
      <el-menu-item index="1" class="active-item" @click="router.push('/')">
        <el-icon><HomeFilled /></el-icon>
        <span>首页</span>
      </el-menu-item>
      <el-menu-item index="2" @click="router.push('/allgz')">
        <el-icon><Star /></el-icon>
        <span>全部关注</span>
      </el-menu-item>
      <el-menu-item index="3" @click="router.push('/new')">
        <el-icon><Bell /></el-icon>
        <span>最新微博</span>
      </el-menu-item>
      <el-menu-item index="4">
        <el-icon><User /></el-icon>
        <span>特别关注</span>
      </el-menu-item>
      <el-menu-item index="5">
        <el-icon><Connection /></el-icon>
        <span>好友圈</span>
      </el-menu-item>
    </el-menu>

    <!-- 自定义分组区域 -->
    <div class="custom-group">
      <div class="group-header">
        <span>自定义分组</span>
        <el-button type="text" size="small" class="manage-btn">管理</el-button>
      </div>
      <el-menu class="group-menu">
        <el-menu-item index="6">
          <span class="group-item">· 同事</span>
        </el-menu-item>
        <el-menu-item index="7">
          <span class="group-item">· 名人明星</span>
        </el-menu-item>
        <el-menu-item index="8">
          <span class="group-item">· 同学</span>
        </el-menu-item>
        <el-menu-item index="9">
          <span class="group-item">· 悄悄关注</span>
        </el-menu-item>
      </el-menu>
    </div>
  </div>
</template>

<script setup>
import {
  HomeFilled,
  Star,
  Bell,
  User,
  Connection
} from '@element-plus/icons-vue'
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { useUserStore } from '@/stores/user'
const router = useRouter()
const userStore = useUserStore()

</script>

<style scoped>
.left-navigation {
  width: 220px;
  background-color: white;
  padding: 20px 0;
}

.main-menu {
  border-right: none;
}

.el-menu-item {
  height: 48px;
  line-height: 48px;
  font-size: 15px;
  color: #666;
}

.el-menu-item.is-active {
  color: #000;
  font-weight: bold;
  background-color: #f5f5f5;
}

.el-menu-item:hover {
  background-color: #f5f5f5;
}

.el-icon {
  margin-right: 10px;
  font-size: 18px;
}

.custom-group {
  margin-top: 20px;
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 10px;
  color: #999;
  font-size: 14px;
}

.manage-btn {
  color: #ff8200;
  border: 1px solid #ff8200;
  border-radius: 4px;
  padding: 2px 8px;
  height: auto;
  line-height: normal;
}

.group-menu {
  border-right: none;
}

.group-item {
  font-size: 14px;
  color: #666;
}

/* 调整Element Plus默认样式 */
:deep(.el-menu) {
  border-right: none;
}

:deep(.el-menu-item) {
  padding-left: 20px !important;
}
</style>